package com.itheima02.day03;

/**
 * @author 刘全
 * @date 2021/7/18
 */
public class test02 {
    public static void main(String[] args) {
        //调用goSwimming方法
        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("憨丕,最爱粪坑蝶泳");
            }
        });
        goSwimming(() -> System.out.println("憨丕,最爱粪坑蝶泳"));
    }
    public static void goSwimming(Swimming swimming){
        swimming.swim();
    }
}
interface Swimming{
    void swim();
}